package com.jsmile.cloud.accountcenter.account.service;

import org.springframework.stereotype.Service;

import com.jsmile.cloud.accountcenter.account.model.AccountInfo;
import com.jsmile.cloud.accountcenter.account.repo.AccountInfoRepository;
import com.jsmile.cloud.accountcenter.api.req.ReqMemberRegister;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Service
@AllArgsConstructor
public class AccountApplicationService {

    private final AccountInfoRepository accountInfoRepository;

    public Boolean register(ReqMemberRegister reqMemberRegister) {
        AccountInfo accountInfo = AccountInfo.register(reqMemberRegister);
        log.info("会员创建:{]", accountInfo);
        return accountInfoRepository.register(accountInfo);
    }
}
